
local shiyong = fk.CreateSkill {
  name = "ls__shiyong",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["ls__shiyong"] = "恃勇",
  [":ls__shiyong"] = "锁定技，当你受到红色【杀】或【酒】【杀】造成的伤害后，你减1点体力上限。",
}

shiyong:addEffect(fk.Damaged, {
  anim_type = "negative",
  can_trigger = function(self, event, target, player, data)
    if target == player and player:hasSkill(shiyong.name) and data.card and data.card.trueName == "slash" then
      if data.card.color == Card.Red then
        return true
      end
      local e = player.room.logic:getCurrentEvent():findParent(GameEvent.UseCard)
      if e then
        local use = e.data
        return use.extra_data and use.extra_data.drankBuff
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    player.room:changeMaxHp(player, -1)
  end,
})

return shiyong
